package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpYAccountUserProfileOrgChartTabPageUtil extends SeleniumPageUtil {
	public final static By UPOC_SPAN_MAIN_HEADER = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_hdrOrgChart_lblHeader");
	
	// elements of Manager
	public final static By UPOC_SPAN_MANAGER = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_Header_lblHeader");
	
	public final static By UPOC_IMG_MANAGER_REPORT_PREFERENCES = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_Header_imgPreferences");
	public final static By UPOC_IMG_MANAGER_EXPORT = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_Header_imgExcelExport");
	
	public final static By UPOC_TD_MANAGER_PAGE = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[2]/tbody/tr[1]/td/table[2]/tbody/tr/td[1]");
	public final static By UPOC_SPAN_MANAGER_PAGE_START_NO = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_PagingTop_lblPagingPageNumber");
	public final static By UPOC_TD_MANAGER_OF = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[2]/tbody/tr[1]/td/table[2]/tbody/tr/td[3]");
	public final static By UPOC_SPAN_MANAGER_PAGE_COUNT = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_PagingTop_lblPagingPageCount");
	
	public final static By UPOC_INPUT_MANAGER_FIRST = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_PagingTop_imgFirst");
	public final static By UPOC_INPUT_MANAGER_PREVIOUS = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_PagingTop_imgPrevious");
	public final static By UPOC_INPUT_MANAGER_NEXT = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_PagingTop_imgNext");
	public final static By UPOC_INPUT_MANAGER_LAST = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_PagingTop_imgLast");
	
	public final static By UPOC_IMG_MANAGER_FILTER_0 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_filter_0");
	public final static By UPOC_IMG_MANAGER_FILTER_1 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_filter_1");
	public final static By UPOC_IMG_MANAGER_FILTER_2 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_filter_2");
	public final static By UPOC_IMG_MANAGER_FILTER_3 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_filter_4");
	public final static By UPOC_IMG_MANAGER_FILTER_4 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_filter_5");
	
	public final static By UPOC_TH_MANAGER_NAME = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_sort_0");
	public final static By UPOC_TH_MANAGER_EMAIL = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_sort_1");
	public final static By UPOC_TH_MANAGER_TITLE = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_sort_2");
	public final static By UPOC_TH_MANAGER_CITY = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_sort_4");
	public final static By UPOC_TH_MANAGER_STATE = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_ManagerReport_sort_5");
	
	// elements of Select User
	public final static By UPOC_SPAN_SELECT_USER = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_Header_lblHeader");
	
	public final static By UPOC_IMG_SU_REPORT_PREFERENCES = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_Header_imgPreferences");
	public final static By UPOC_IMG_SU_EXPORT = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_Header_imgExcelExport");
	
	public final static By UPOC_TD_SU_PAGE = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[2]/tbody/tr[2]/td[2]/table[2]/tbody/tr/td[1]");
	public final static By UPOC_SPAN_SU_PAGE_START_NO = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_PagingTop_lblPagingPageNumber");
	public final static By UPOC_TD_SU_OF = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[2]/tbody/tr[2]/td[2]/table[2]/tbody/tr/td[3]");
	public final static By UPOC_SPAN_SU_PAGE_COUNT = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_PagingTop_lblPagingPageCount");
	
	public final static By UPOC_INPUT_SU_FIRST = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_PagingTop_imgFirst");
	public final static By UPOC_INPUT_SU_PREVIOUS = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_PagingTop_imgPrevious");
	public final static By UPOC_INPUT_SU_NEXT = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_PagingTop_imgNext");
	public final static By UPOC_INPUT_SU_LAST = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_PagingTop_imgLast");
	
	public final static By UPOC_IMG_SU_FILTER_0 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_filter_0");
	public final static By UPOC_IMG_SU_FILTER_1 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_filter_1");
	public final static By UPOC_IMG_SU_FILTER_2 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_filter_2");
	public final static By UPOC_IMG_SU_FILTER_3 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_filter_4");
	public final static By UPOC_IMG_SU_FILTER_4 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_filter_5");
	
	public final static By UPOC_TH_SU_NAME = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_sort_0");
	public final static By UPOC_TH_SU_EMAIL = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_sort_1");
	public final static By UPOC_TH_SU_TITLE = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_sort_2");
	public final static By UPOC_TH_SU_CITY = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_sort_4");
	public final static By UPOC_TH_SU_STATE = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_sort_5");
	
	public final static By UPOC_TD_SU_NAME = By.xpath("//*[@id='ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_ReportOutput']/table/tbody/tr[3]/td[1]");
	public final static By UPOC_TD_SU_EMAIL = By.xpath("//*[@id='ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_ReportOutput']/table/tbody/tr[3]/td[2]/a");
	public final static By UPOC_TD_SU_TITLE = By.xpath("//*[@id='ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_ReportOutput']/table/tbody/tr[3]/td[3]");
	public final static By UPOC_TD_SU_CITY = By.xpath("//*[@id='ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_ReportOutput']/table/tbody/tr[3]/td[4]");
	public final static By UPOC_TD_SU_STATE = By.xpath("//*[@id='ctl44_ParentChildContainer_UserProfile_OrgChart1_SelectedUser_ReportOutput']/table/tbody/tr[3]/td[5]");
	
	// elements of Direct Reports
	public final static By UPOC_SPAN_DIRECT_REPORTS = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_Header_lblHeader");
	
	public final static By UPOC_IMG_DR_REPORT_PREFERENCES = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_Header_imgPreferences");
	public final static By UPOC_IMG_DR_EXPORT = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_Header_imgExcelExport");
	
	public final static By UPOC_TD_DR_PAGE = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[2]/tbody/tr[3]/td[3]/table[2]/tbody/tr/td[1]");
	public final static By UPOC_SPAN_DR_PAGE_START_NO = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_PagingTop_lblPagingPageNumber");
	public final static By UPOC_TD_DR_OF = By.xpath("//*[@id='ctl44_ParentChildContainer_PnlChildControl']/table[2]/tbody/tr[3]/td[3]/table[2]/tbody/tr/td[3]");
	public final static By UPOC_SPAN_DR_PAGE_COUNT = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_PagingTop_lblPagingPageCount");
	
	public final static By UPOC_INPUT_DR_FIRST = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_PagingTop_imgFirst");
	public final static By UPOC_INPUT_DR_PREVIOUS = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_PagingTop_imgPrevious");
	public final static By UPOC_INPUT_DR_NEXT = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_PagingTop_imgNext");
	public final static By UPOC_INPUT_DR_LAST = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_PagingTop_imgLast");
	
	public final static By UPOC_IMG_DR_FILTER_0 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_filter_0");
	public final static By UPOC_IMG_DR_FILTER_1 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_filter_1");
	public final static By UPOC_IMG_DR_FILTER_2 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_filter_2");
	public final static By UPOC_IMG_DR_FILTER_3 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_filter_4");
	public final static By UPOC_IMG_DR_FILTER_4 = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_filter_5");
	
	public final static By UPOC_TH_DR_NAME = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_sort_0");
	public final static By UPOC_TH_DR_EMAIL = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_sort_1");
	public final static By UPOC_TH_DR_TITLE = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_sort_2");
	public final static By UPOC_TH_DR_CITY = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_sort_4");
	public final static By UPOC_TH_DR_STATE = By.id("ctl44_ParentChildContainer_UserProfile_OrgChart1_DirectReportsReport_sort_5");
	
	
	public static void enterYourAccountUserProfileSelectUserPage(){
		SpHomePageUtil.enter();
		SpHomePageUtil.changeCustomer("SMS MASTER");
		SpHomePageUtil.enterYourAccountUserProfileDefaultPage();
		SpYAccountUserProfileDefaultPageUtil.waitForUserProfileDefaultPageToLoad();
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpYAccountUserProfileDefaultPageUtil.YAUP_TAB_ORG_CHART));
		waitForPageToLoad();
	}
	
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				UPOC_IMG_MANAGER_REPORT_PREFERENCES, UPOC_IMG_MANAGER_EXPORT, UPOC_INPUT_MANAGER_FIRST, UPOC_INPUT_MANAGER_PREVIOUS, UPOC_INPUT_MANAGER_NEXT,UPOC_INPUT_MANAGER_LAST, 
				UPOC_IMG_MANAGER_FILTER_0, UPOC_IMG_MANAGER_FILTER_1, UPOC_IMG_MANAGER_FILTER_2, UPOC_IMG_MANAGER_FILTER_3, UPOC_IMG_MANAGER_FILTER_4,
				
				UPOC_IMG_SU_REPORT_PREFERENCES, UPOC_IMG_SU_EXPORT, UPOC_INPUT_SU_FIRST, UPOC_INPUT_SU_PREVIOUS, UPOC_INPUT_SU_NEXT, UPOC_INPUT_SU_LAST,
				UPOC_IMG_SU_FILTER_0, UPOC_IMG_SU_FILTER_1, UPOC_IMG_SU_FILTER_2, UPOC_IMG_SU_FILTER_3, UPOC_IMG_SU_FILTER_4,
				
				UPOC_IMG_DR_REPORT_PREFERENCES, UPOC_IMG_DR_EXPORT, UPOC_INPUT_DR_FIRST, UPOC_INPUT_DR_PREVIOUS, UPOC_INPUT_DR_NEXT, UPOC_INPUT_DR_LAST, 
				UPOC_IMG_DR_FILTER_0, UPOC_IMG_DR_FILTER_1, UPOC_IMG_DR_FILTER_2, UPOC_IMG_DR_FILTER_3, UPOC_IMG_DR_FILTER_4
			});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_MANAGER_REPORT_PREFERENCES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_MANAGER_EXPORT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_MANAGER_FIRST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_MANAGER_PREVIOUS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_MANAGER_NEXT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_MANAGER_LAST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_MANAGER_FILTER_0));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_MANAGER_FILTER_1));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_MANAGER_FILTER_2));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_MANAGER_FILTER_3));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_MANAGER_FILTER_4));
		
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_SU_REPORT_PREFERENCES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_SU_EXPORT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_SU_FIRST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_SU_PREVIOUS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_SU_NEXT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_SU_LAST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_SU_FILTER_0));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_SU_FILTER_1));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_SU_FILTER_2));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_SU_FILTER_3));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_SU_FILTER_4));

		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_DR_REPORT_PREFERENCES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_DR_EXPORT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_DR_FIRST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_DR_PREVIOUS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_DR_NEXT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_INPUT_DR_LAST));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_DR_FILTER_0));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_DR_FILTER_1));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_DR_FILTER_2));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_SU_FILTER_3));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(UPOC_IMG_SU_FILTER_4));
	}
	
}
